import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Select from '../views/select.vue'
import NewsList from '../views/Newslist.vue'
import NewsDetails from '../views/NewsDetails.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect:"/home/newslist/1"
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children:[
      {
        path:'newslist/:id',
        name:NewsList,
        component:NewsList
      }
    ]
  },
  {
    path:'/select',
    name:"Select",
    component:Select
  },
  {
    path:'/newsdetails/:id',
    name:"NewsDetails",
    component:NewsDetails
  }
]

const router = new VueRouter({
  routes
})

export default router
